package com.kaifamiao.wendao.dao;

import com.kaifamiao.wendao.utils.DataSourceFactory;
import org.apache.commons.dbutils.QueryRunner;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * 所有DAO类的公共基类
 */
public abstract class BaseDao<E,P> implements Dao<E,P>{

    protected QueryRunner runner;

    protected BaseDao(){
        super();
        DataSourceFactory factory = DataSourceFactory.getInstance();
        DataSource dataSource = factory.getDataSource();
        runner = new QueryRunner(dataSource);
    }


}
